[XEN] Add tracing to slow path in setting new guest %cr3 value.
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Tue, 15 Aug 2006 15:31:14 +0000 (16:31 +0100)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Tue, 15 Aug 2006 15:31:14 +0000 (16:31 +0100)
Also, allow x86/64 user cr3 value to be reset to zero.
Signed-off-by: Gerd Hoffmann <kraxel@suse.de>
xen/arch/x86/mm.c

index 9664a2cda006cf9793b8654e805d1d40453fd134..b5b778d83f04a6c10c78cad97f35ec17773bece4 100644 (file)
@@ -1744,6 +1744,7 @@ int new_guest_cr3(unsigned long mfn)
         if ( unlikely(!okay) )
         {
             /* Switch to idle pagetable: this VCPU has no active p.t. now. */
+            MEM_LOG("New baseptr %lx: slow path via idle pagetables", mfn);
             old_base_mfn = pagetable_get_pfn(v->arch.guest_table);
             v->arch.guest_table = pagetable_null();
             update_pagetables(v);
@@ -2025,8 +2026,10 @@ int do_mmuext_op(
         
 #ifdef __x86_64__
         case MMUEXT_NEW_USER_BASEPTR:
-            okay = get_page_and_type_from_pagenr(
-                mfn, PGT_root_page_table, d);
+            okay = 1;
+            if (likely(mfn != 0))
+                okay = get_page_and_type_from_pagenr(
+                    mfn, PGT_root_page_table, d);
             if ( unlikely(!okay) )
             {
                 MEM_LOG("Error while installing new mfn %lx", mfn);